package com.test;

import com.Dao.BookDao;
import com.Dao.UserDao;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DemoTest02 {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
    @Test
    public void m1(){
        BookDao bookDao = (BookDao)ctx.getBean("bookDao1");
        bookDao.save();

    }
    @Test
    public void m2(){
        BookDao bookDao = (BookDao)ctx.getBean("bookDao");
        bookDao.save();
        System.out.println(bookDao);
    }
    @Test
    public void m3(){
        UserDao dao =
                (UserDao) ctx.getBean("userDao");
        dao.save();
    }
}
